package model

type person struct{
	Name string
	age int   //private
	sal float64  //private
}

func PersonFactory(name string)*person{
	return &person{
		Name : name,
	}
}

func (p *person)SetAge(age int){  //封装属性age
	if age <= 0 || age >= 200{
		return
	}
	p.age = age
}
func (p *person)GetAge() int{
	return p.age
}
func (p *person)SetSal(sal float64){  //封装属性sal
	if sal <= 3500 || sal >= 20000{
		return
	}
	p.sal = sal
}
func (p *person)GetSal() float64{
	return p.sal
}